package com.study.project.dao;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

@TableName("users")
@Data
public class UserDO implements Serializable {


    @NotNull(message = "[]不能为空")
    @ApiModelProperty("")
    @TableId(type = IdType.AUTO)
    private Integer userId;

    @NotBlank(message = "[]不能为空")
    @Size(max = 100, message = "编码长度不能超过100")
    @ApiModelProperty("")
    @Length(max = 100, message = "编码长度不能超过100")
    private String userName;

    @NotNull(message = "[]不能为空")
    @ApiModelProperty("")
    private Integer gender;

    @ApiModelProperty("")
    private Date birthDate;

    @NotBlank(message = "[]不能为空")
    @Size(max = 20, message = "编码长度不能超过20")
    @ApiModelProperty("")
    @Length(max = 20, message = "编码长度不能超过20")
    private String phoneNumber;

    @NotBlank(message = "[]不能为空")
    @Size(max = 255, message = "编码长度不能超过255")
    @ApiModelProperty("")
    @Length(max = 255, message = "编码长度不能超过255")
    private String email;

    @NotNull(message = "[]不能为空")
    @ApiModelProperty("")
    private Integer roleId;


    @NotBlank(message = "[]不能为空")
    @Size(max = 255, message = "编码长度不能超过255")
    @ApiModelProperty("")
    @Length(max = 255, message = "编码长度不能超过255")
    private String password;
    /**
     *
     */
    @Size(max = 255, message = "编码长度不能超过255")
    @ApiModelProperty("")
    @Length(max = 255, message = "编码长度不能超过255")
    private String address;

    /**
     *
     */
    @NotNull(message = "[]不能为空")
    @ApiModelProperty("")
    @TableLogic
    private Boolean isDeleted;
    /**
     *
     */
    @ApiModelProperty("")
    private Date createdAt;
    /**
     *
     */
    @ApiModelProperty("")
    private Date updatedAt;
    /**
     * 创建人
     */
    @Size(max = 20, message = "编码长度不能超过20")
    @ApiModelProperty("创建人")
    @Length(max = 20, message = "编码长度不能超过20")
    private String createBy;
    /**
     * 更新人
     */
    @Size(max = 20, message = "编码长度不能超过20")
    @ApiModelProperty("更新人")
    @Length(max = 20, message = "编码长度不能超过20")
    private String updateBy;
}
